Integrand size = 31, antiderivative size = 89 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=\frac {d^2 \text {arctanh}(\sin (e+f x))}{a^2 f}+\frac {(c-d)^2 \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {(c-d) (c+5 d) \tan (e+f x)}{3 f \left (a^2+a^2 \sec (e+f x)\right )} \]
[Out]
Time = 0.18 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.67, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4072, 91, 79, 65, 223, 209} \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=\frac {(c+5 d) (c-d) \tan (e+f x)}{3 f \left (a^2 \sec (e+f x)+a^2\right )}+\frac {2 d^2 \tan (e+f x) \arctan \left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a (\sec (e+f x)+1)}}\right )}{a f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {(c-d)^2 \tan (e+f x)}{3 f (a \sec (e+f x)+a)^2} \]
[In]
[Out]
Rule 65
Rule 79
Rule 91
Rule 209
Rule 223
Rule 4072
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(c+d x)^2}{\sqrt {a-a x} (a+a x)^{5/2}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {(c-d)^2 \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac {\tan (e+f x) \text {Subst}\left (\int \frac {a^3 \left (c^2+4 c d-2 d^2\right )+3 a^3 d^2 x}{\sqrt {a-a x} (a+a x)^{3/2}} \, dx,x,\sec (e+f x)\right )}{3 a^2 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {(c-d)^2 \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {(c-d) (c+5 d) \tan (e+f x)}{3 f \left (a^2+a^2 \sec (e+f x)\right )}-\frac {\left (d^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {(c-d)^2 \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {(c-d) (c+5 d) \tan (e+f x)}{3 f \left (a^2+a^2 \sec (e+f x)\right )}+\frac {\left (2 d^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2 a-x^2}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{a f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {(c-d)^2 \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {(c-d) (c+5 d) \tan (e+f x)}{3 f \left (a^2+a^2 \sec (e+f x)\right )}+\frac {\left (2 d^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right )}{a f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {(c-d)^2 \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {2 d^2 \arctan \left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right ) \tan (e+f x)}{a f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {(c-d) (c+5 d) \tan (e+f x)}{3 f \left (a^2+a^2 \sec (e+f x)\right )} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(181\) vs. \(2(89)=178\).
Time = 2.41 (sec) , antiderivative size = 181, normalized size of antiderivative = 2.03 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=-\frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \left (6 d^2 \cos ^3\left (\frac {1}{2} (e+f x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )+(c-d)^2 \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )-4 \left (c^2+c d-2 d^2\right ) \cos ^2\left (\frac {1}{2} (e+f x)\right ) \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )+(c-d)^2 \cos \left (\frac {1}{2} (e+f x)\right ) \tan \left (\frac {e}{2}\right )\right )}{3 a^2 f (1+\cos (e+f x))^2} \]
[In]
[Out]
Time = 0.65 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.94
method | result | size |
parallelrisch | \(\frac {-6 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) d^{2}+6 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) d^{2}-\left (c -d \right ) \left (\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-3 c -9 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{6 a^{2} f}\) | \(84\) |
derivativedivides | \(\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d +\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c d}{3}+\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2}-3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}-2 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) d^{2}-\frac {c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3}-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d^{2}}{3}+2 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) d^{2}}{2 f \,a^{2}}\) | \(131\) |
default | \(\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d +\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c d}{3}+\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2}-3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}-2 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) d^{2}-\frac {c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3}-\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d^{2}}{3}+2 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) d^{2}}{2 f \,a^{2}}\) | \(131\) |
risch | \(\frac {2 i \left (3 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}-3 d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+3 c^{2} {\mathrm e}^{i \left (f x +e \right )}+6 d \,{\mathrm e}^{i \left (f x +e \right )} c -9 d^{2} {\mathrm e}^{i \left (f x +e \right )}+2 c^{2}+2 c d -4 d^{2}\right )}{3 f \,a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a^{2} f}-\frac {d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a^{2} f}\) | \(155\) |
norman | \(\frac {-\frac {\left (c^{2}-2 c d +d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{6 a f}+\frac {\left (c^{2}+2 c d -3 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 a f}+\frac {\left (5 c^{2}+2 c d -7 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{6 a f}-\frac {\left (7 c^{2}+10 c d -17 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{6 a f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{2} a}+\frac {d^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a^{2} f}-\frac {d^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a^{2} f}\) | \(195\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.74 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=\frac {3 \, {\left (d^{2} \cos \left (f x + e\right )^{2} + 2 \, d^{2} \cos \left (f x + e\right ) + d^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (d^{2} \cos \left (f x + e\right )^{2} + 2 \, d^{2} \cos \left (f x + e\right ) + d^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (c^{2} + 4 \, c d - 5 \, d^{2} + 2 \, {\left (c^{2} + c d - 2 \, d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{6 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}} \]
[In]
[Out]
\[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=\frac {\int \frac {c^{2} \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {d^{2} \sec ^{3}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {2 c d \sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx}{a^{2}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (85) = 170\).
Time = 0.22 (sec) , antiderivative size = 195, normalized size of antiderivative = 2.19 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=-\frac {d^{2} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2}} + \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a^{2}}\right )} - \frac {2 \, c d {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}} - \frac {c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, f} \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.78 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=\frac {\frac {6 \, d^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a^{2}} - \frac {6 \, d^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a^{2}} - \frac {a^{4} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, a^{4} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + a^{4} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3 \, a^{4} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 6 \, a^{4} c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 9 \, a^{4} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a^{6}}}{6 \, f} \]
[In]
[Out]
Time = 13.42 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx=\frac {2\,d^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{a^2\,f}-\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (\frac {{\left (c-d\right )}^2}{2\,a^2}-\frac {c^2-d^2}{a^2}\right )}{f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,{\left (c-d\right )}^2}{6\,a^2\,f} \]
[In]
[Out]